<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>p2_元素消失方式</title>
    <style>
        div{
            width: 200px;
            height: 200px;
        }
        .d1{
            background-color: lightgreen;
        }
        .d1:hover{
            display: none;
        }
        .d2{
            background-color: lightpink;
        }
        .d2:hover{
            transform:scale(0) ;
        }
        .d3{
            background-color: lightcoral;
            border: 4px solid #000;
        }
        .d3:hover{
            background-color: rgba(0,0,0,0);
        }
        .d4{
            background-color: lightsalmon;
        }
        .d4:hover{
            opacity: 0.5;
            opacity: 0;
        }
    </style>
</head>
<body>
<div class="d1">111</div>
<div class="d2">222</div>
<div class="d3">333</div>
<div class="d4">444</div>
</body>
</html>